import { FImage } from '@/components/common/Formily/components/Image'
import { ISchema } from '@formily/vue'
import { Component } from 'vue'

const citySchema: ISchema = {
    type: 'object',
    properties: {
        layout: {
            type: 'void',
            'x-component': 'FormGrid',
            'x-component-props': {
                maxColumns: 3,
                minColumns: 2,
            },
            properties: {
                test: {
                    type: 'object',
                    title: '123',
                    'x-component': 'FImage',
                    'x-decorator': 'FormItem',
                    'x-decorator-props': {
                        // gridSpan: 'span 1',
                    },
                    'x-component-props': {
                        imgList: [
                            {
                                id: 'a',
                                name: '我是自带url的图片.png',
                                status: 'finished',
                                url: 'https://07akioni.oss-cn-beijing.aliyuncs.com/07akioni.jpeg',
                            },
                            {
                                id: 'b',
                                name: '我是自带url的图片.png',
                                status: 'finished',
                                url: 'https://07akioni.oss-cn-beijing.aliyuncs.com/07akioni.jpeg',
                            },
                            {
                                id: 'c',
                                name: '我是自带url的图片.png',
                                status: 'finished',
                                url: 'https://07akioni.oss-cn-beijing.aliyuncs.com/07akioni.jpeg',
                            },
                            {
                                id: 'd',
                                name: '我是自带url的图片.png',
                                status: 'finished',
                                url: 'https://07akioni.oss-cn-beijing.aliyuncs.com/07akioni.jpeg',
                            },
                        ],
                    },
                    'x-read-pretty': true,
                },
                // 阅读态下的值,可以通过modelValue 设定来进行显示
                abc: {
                    title: 'abc',
                    type: 'string',
                    'x-decorator': 'FormItem',
                    'x-decorator-props': {
                        // gridSpan: 'span 1',
                    },
                    'x-component': 'FInput',
                    'x-component-props': {
                        modelValue: '123',
                    },
                    default: '123',
                    'x-read-pretty': true,
                },
            },
        },
    },
}

const peopleSchema: ISchema = {
    type: 'object',
    properties: {
        layout: {
            type: 'void',
            'x-component': 'FormGrid',
            'x-component-props': {
                maxColumns: 3,
                minColumns: 2,
            },
            properties: {
                test: {
                    type: 'object',
                    title: '123',
                    'x-component': 'FImage',
                    'x-decorator': 'FormItem',
                    'x-decorator-props': {
                        // gridSpan: 'span 1',
                    },
                    'x-component-props': {
                        imgList: [
                            {
                                id: 'a',
                                name: '我是自带url的图片.png',
                                status: 'finished',
                                url: 'https://07akioni.oss-cn-beijing.aliyuncs.com/07akioni.jpeg',
                            },
                            {
                                id: 'b',
                                name: '我是自带url的图片.png',
                                status: 'finished',
                                url: 'https://07akioni.oss-cn-beijing.aliyuncs.com/07akioni.jpeg',
                            },
                            {
                                id: 'c',
                                name: '我是自带url的图片.png',
                                status: 'finished',
                                url: 'https://07akioni.oss-cn-beijing.aliyuncs.com/07akioni.jpeg',
                            },
                            {
                                id: 'd',
                                name: '我是自带url的图片.png',
                                status: 'finished',
                                url: 'https://07akioni.oss-cn-beijing.aliyuncs.com/07akioni.jpeg',
                            },
                        ],
                    },
                    'x-read-pretty': true,
                },
                // 阅读态下的值,可以通过modelValue 设定来进行显示
                abc: {
                    title: 'abc',
                    type: 'string',
                    'x-decorator': 'FormItem',
                    'x-decorator-props': {
                        // gridSpan: 'span 1',
                    },
                    'x-component': 'FInput',
                    'x-component-props': {
                        modelValue: '123',
                    },
                    default: '123',
                    'x-read-pretty': true,
                },
            },
        },
    },
}

const transficationSchema: ISchema = {
    type: 'object',
    properties: {
        layout: {
            type: 'void',
            'x-component': 'FormGrid',
            'x-component-props': {
                maxColumns: 3,
                minColumns: 2,
            },
            properties: {
                test: {
                    type: 'object',
                    title: '123',
                    'x-component': 'FImage',
                    'x-decorator': 'FormItem',
                    'x-decorator-props': {
                        // gridSpan: 'span 1',
                    },
                    'x-component-props': {
                        imgList: [
                            {
                                id: 'a',
                                name: '我是自带url的图片.png',
                                status: 'finished',
                                url: 'https://07akioni.oss-cn-beijing.aliyuncs.com/07akioni.jpeg',
                            },
                            {
                                id: 'b',
                                name: '我是自带url的图片.png',
                                status: 'finished',
                                url: 'https://07akioni.oss-cn-beijing.aliyuncs.com/07akioni.jpeg',
                            },
                            {
                                id: 'c',
                                name: '我是自带url的图片.png',
                                status: 'finished',
                                url: 'https://07akioni.oss-cn-beijing.aliyuncs.com/07akioni.jpeg',
                            },
                            {
                                id: 'd',
                                name: '我是自带url的图片.png',
                                status: 'finished',
                                url: 'https://07akioni.oss-cn-beijing.aliyuncs.com/07akioni.jpeg',
                            },
                        ],
                    },
                    'x-read-pretty': true,
                },
                // 阅读态下的值,可以通过modelValue 设定来进行显示
                abc: {
                    title: 'abc',
                    type: 'string',
                    'x-decorator': 'FormItem',
                    'x-decorator-props': {
                        // gridSpan: 'span 1',
                    },
                    'x-component': 'FInput',
                    'x-component-props': {
                        modelValue: '123',
                    },
                    default: '123',
                    'x-read-pretty': true,
                },
            },
        },
    },
}

const plantformSchema: ISchema = {
    type: 'object',
    properties: {
        layout: {
            type: 'void',
            'x-component': 'FormGrid',
            'x-component-props': {
                maxColumns: 3,
                minColumns: 2,
            },
            properties: {
                test: {
                    type: 'object',
                    title: '123',
                    'x-component': 'FImage',
                    'x-decorator': 'FormItem',
                    'x-decorator-props': {
                        // gridSpan: 'span 1',
                    },
                    'x-component-props': {
                        imgList: [
                            {
                                id: 'a',
                                name: '我是自带url的图片.png',
                                status: 'finished',
                                url: 'https://07akioni.oss-cn-beijing.aliyuncs.com/07akioni.jpeg',
                            },
                            {
                                id: 'b',
                                name: '我是自带url的图片.png',
                                status: 'finished',
                                url: 'https://07akioni.oss-cn-beijing.aliyuncs.com/07akioni.jpeg',
                            },
                            {
                                id: 'c',
                                name: '我是自带url的图片.png',
                                status: 'finished',
                                url: 'https://07akioni.oss-cn-beijing.aliyuncs.com/07akioni.jpeg',
                            },
                            {
                                id: 'd',
                                name: '我是自带url的图片.png',
                                status: 'finished',
                                url: 'https://07akioni.oss-cn-beijing.aliyuncs.com/07akioni.jpeg',
                            },
                        ],
                    },
                    'x-read-pretty': true,
                },
                // 阅读态下的值,可以通过modelValue 设定来进行显示
                abc: {
                    title: 'abc',
                    type: 'string',
                    'x-decorator': 'FormItem',
                    'x-decorator-props': {
                        // gridSpan: 'span 1',
                    },
                    'x-component': 'FInput',
                    'x-component-props': {
                        modelValue: '123',
                    },
                    default: '123',
                    'x-read-pretty': true,
                },
            },
        },
    },
}

const weaponSchema: ISchema = {
    type: 'object',
    properties: {
        layout: {
            type: 'void',
            'x-component': 'FormGrid',
            'x-component-props': {
                maxColumns: 3,
                minColumns: 2,
            },
            properties: {
                test: {
                    type: 'object',
                    title: '123',
                    'x-component': 'FImage',
                    'x-decorator': 'FormItem',
                    'x-decorator-props': {
                        // gridSpan: 'span 1',
                    },
                    'x-component-props': {
                        imgList: [
                            {
                                id: 'a',
                                name: '我是自带url的图片.png',
                                status: 'finished',
                                url: 'https://07akioni.oss-cn-beijing.aliyuncs.com/07akioni.jpeg',
                            },
                            {
                                id: 'b',
                                name: '我是自带url的图片.png',
                                status: 'finished',
                                url: 'https://07akioni.oss-cn-beijing.aliyuncs.com/07akioni.jpeg',
                            },
                            {
                                id: 'c',
                                name: '我是自带url的图片.png',
                                status: 'finished',
                                url: 'https://07akioni.oss-cn-beijing.aliyuncs.com/07akioni.jpeg',
                            },
                            {
                                id: 'd',
                                name: '我是自带url的图片.png',
                                status: 'finished',
                                url: 'https://07akioni.oss-cn-beijing.aliyuncs.com/07akioni.jpeg',
                            },
                        ],
                    },
                    'x-read-pretty': true,
                },
                // 阅读态下的值,可以通过modelValue 设定来进行显示
                abc: {
                    title: 'abc',
                    type: 'string',
                    'x-decorator': 'FormItem',
                    'x-decorator-props': {
                        // gridSpan: 'span 1',
                    },
                    'x-component': 'FInput',
                    'x-component-props': {
                        modelValue: '123',
                    },
                    default: '123',
                    'x-read-pretty': true,
                },
            },
        },
    },
}

const airportSchema: ISchema = {
    type: 'object',
    properties: {
        layout: {
            type: 'void',
            'x-component': 'FormGrid',
            'x-component-props': {
                maxColumns: 3,
                minColumns: 2,
            },
            properties: {
                test: {
                    type: 'object',
                    title: '123',
                    'x-component': 'FImage',
                    'x-decorator': 'FormItem',
                    'x-decorator-props': {
                        // gridSpan: 'span 1',
                    },
                    'x-component-props': {
                        imgList: [
                            {
                                id: 'a',
                                name: '我是自带url的图片.png',
                                status: 'finished',
                                url: 'https://07akioni.oss-cn-beijing.aliyuncs.com/07akioni.jpeg',
                            },
                            {
                                id: 'b',
                                name: '我是自带url的图片.png',
                                status: 'finished',
                                url: 'https://07akioni.oss-cn-beijing.aliyuncs.com/07akioni.jpeg',
                            },
                            {
                                id: 'c',
                                name: '我是自带url的图片.png',
                                status: 'finished',
                                url: 'https://07akioni.oss-cn-beijing.aliyuncs.com/07akioni.jpeg',
                            },
                            {
                                id: 'd',
                                name: '我是自带url的图片.png',
                                status: 'finished',
                                url: 'https://07akioni.oss-cn-beijing.aliyuncs.com/07akioni.jpeg',
                            },
                        ],
                    },
                    'x-read-pretty': true,
                },
                // 阅读态下的值,可以通过modelValue 设定来进行显示
                abc: {
                    title: 'abc',
                    type: 'string',
                    'x-decorator': 'FormItem',
                    'x-decorator-props': {
                        // gridSpan: 'span 1',
                    },
                    'x-component': 'FInput',
                    'x-component-props': {
                        modelValue: '123',
                    },
                    default: '123',
                    'x-read-pretty': true,
                },
            },
        },
    },
}

const dockSchema: ISchema = {
    type: 'object',
    properties: {
        layout: {
            type: 'void',
            'x-component': 'FormGrid',
            'x-component-props': {
                maxColumns: 3,
                minColumns: 2,
            },
            properties: {
                image: {
                    type: 'object',
                    title: '预览图片',
                    'x-component': 'FImage',
                    // 'x-component': '',

                    'x-decorator': 'FormItem',
                    'x-decorator-props': {
                        // gridSpan: 'span 1',
                    },
                    'x-component-props': {
                        imgList: [
                            {
                                id: 'a',
                                name: '我是自带url的图片.png',
                                status: 'finished',
                                url: 'https://07akioni.oss-cn-beijing.aliyuncs.com/07akioni.jpeg',
                            },
                            {
                                id: 'b',
                                name: '我是自带url的图片.png',
                                status: 'finished',
                                url: 'https://07akioni.oss-cn-beijing.aliyuncs.com/07akioni.jpeg',
                            },
                            {
                                id: 'c',
                                name: '我是自带url的图片.png',
                                status: 'finished',
                                url: 'https://07akioni.oss-cn-beijing.aliyuncs.com/07akioni.jpeg',
                            },
                            {
                                id: 'd',
                                name: '我是自带url的图片.png',
                                status: 'finished',
                                url: 'https://07akioni.oss-cn-beijing.aliyuncs.com/07akioni.jpeg',
                            },
                        ],
                    },
                    'x-read-pretty': true,
                },
                // 阅读态下的值,可以通过modelValue 设定来进行显示
                abc: {
                    'x-component': 'FormLayout',
                    'x-component-props': {
                        // maxColumns: 3,
                        // minColumns: 2,
                        // rowGap:1,
                        labelCol: 3,
                    },

                    // title: 'abc',
                    type: 'void',

                    properties: {
                        name: {
                            type: 'string',
                            title: '目标名称',
                            'x-decorator': 'FormItem',
                            'x-decorator-props': {
                                // gridSpan: 'span 1',
                            },
                            'x-component': 'FInput',
                            'x-component-props': {
                                modelValue: '123',
                            },
                            default: '123',
                            'x-read-pretty': true,
                        },
                        abc2: {
                            type: 'string',
                            title: '国家地区',
                            'x-decorator': 'FormItem',
                            'x-decorator-props': {
                                // gridSpan: 'span 1',
                            },
                            'x-component': 'FInput',
                            'x-component-props': {
                                modelValue: '123',
                            },
                            default: '123',
                            'x-read-pretty': true,
                        },
                        abc3: {
                            type: 'string',
                            title: '类型',
                            'x-decorator': 'FormItem',
                            'x-decorator-props': {
                                // gridSpan: 'span 1',
                            },
                            'x-component': 'FInput',
                            'x-component-props': {
                                modelValue: '123',
                            },
                            default: '123',
                            'x-read-pretty': true,
                        },
                        abc4: {
                            type: 'string',
                            title: '面积',
                            'x-decorator': 'FormItem',
                            'x-decorator-props': {
                                // gridSpan: 'span 1',
                            },
                            'x-component': 'FInput',
                            'x-component-props': {
                                modelValue: '123',
                            },
                            default: '123',
                            'x-read-pretty': true,
                        },
                        abc5: {
                            type: 'string',
                            title: '状况',
                            'x-decorator': 'FormItem',
                            'x-decorator-props': {
                                // gridSpan: 'span 1',
                            },
                            'x-component': 'FInput',
                            'x-component-props': {
                                modelValue: '123',
                            },
                            default: '123',
                            'x-read-pretty': true,
                        },
                        abc6: {
                            type: 'string',
                            title: '地位作用',
                            'x-decorator': 'FormItem',
                            'x-decorator-props': {
                                // gridSpan: 'span 1',
                            },
                            'x-component': 'FInput',
                            'x-component-props': {
                                modelValue: '123',
                            },
                            default: '123',
                            'x-read-pretty': true,
                        },
                        abc7: {
                            type: 'string',
                            title: '构成结构',
                            'x-decorator': 'FormItem',
                            'x-decorator-props': {
                                // gridSpan: 'span 1',
                            },
                            'x-component': 'FInput',
                            'x-component-props': {
                                modelValue: '123',
                            },
                            default: '123',
                            'x-read-pretty': true,
                        },
                    },
                },
            },
        },
    },
}

function toJSON(obj: any): string {
    return JSON.stringify(obj, null, 4)
}

export default {
    citySchema: toJSON(citySchema),
    peopleSchema: toJSON(peopleSchema),
    transficationSchema: toJSON(transficationSchema),
    plantformSchema: toJSON(plantformSchema),
    weaponSchema: toJSON(weaponSchema),
    airportSchema: toJSON(airportSchema),
    dockSchema: toJSON(dockSchema),
}
